<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="${shopPo.name!}" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>${shopPo.name!}</title>
<link href="/css/common.css" type="text/css" rel="stylesheet" />
<link href="/css/index.css" type="text/css" rel="stylesheet" />
<link href="/css/icons.css" type="text/css" rel="stylesheet" />
<link href="/css/product.css" type="text/css" rel="stylesheet" />
<link href="/css/ucenter.css" type="text/css" rel="stylesheet" />
<link href="/css/add2home.css" type="text/css" rel="stylesheet" />

<script src="/js/jquery.js" type="text/javascript"></script>
<script src="/js/caichong_common.js" type="text/javascript"></script>
<script src="/js/jquery.validate.min.js" type="text/javascript"></script>
  
  <link href="/css/style.css" rel="stylesheet" type="text/css" />
  <script src="/js/common.js"></script>
  <script>var shop = "shop_${shopPo.id!}";</script>
 </head>
 <body>
 <!--div id="loading">菜单加载中..</div>  -->
 <div id="container">
	
	<div id="header" style="position:fixed;top:0px;">
		<div id="left">
			<a href="/shop/${shopPo.id!}"><img src="/images/transparent.png" class="return" /></a>
			<h1>${shopPo.name!}</h1>
		</div>
		<div id="right">
			<!-- <a href="/cart/view/${shopPo.id!}">购物车</a>&nbsp;<a href="/"><img src="/images/transparent.png" class="index" /></a> -->
			<!-- <input type="button" value="一键点菜" onclick="" class="autoDish"> -->
			<div class="top-shortcuts">
				<ul>
					<li class="ucenter"><a href="/home/login">用户中心</a></li>
					<li class="cates"><a href="/menu/categories">全部分类</a></li>
					<li class="cart" id="shoppingcart"><a href="/cart/view/${shopPo.id!}">购物车</a></li>
				</ul>
			</div>
		</div>
	</div>
	
	<div id="menu">
		<div id="leftClassify">
			<ul id="classify" style="margin-top: 0px;top: 82px;">
				<#list productTypeList as type>
					<#if type_index == 0 >
						<li id="classify_${type.id!}" class="selected">${type.name}</li>
					<#elseif type_index gt 0>
						<li id="classify_${type.id!}">${type.name}</li>
					</#if>
				</#list>
				
			</ul>
		</div>
		<#list map.keySet() as idKey> 
			<div id="dishes_classify_${idKey!}" class="<#if idKey_index==0>right visible</#if><#if idKey_index gt 0>right hidden</#if>">
			<ul>
			<#list map.get(idKey) as x >
				<li id="dishes_${x.id!}" title="${x.name!}">
					<img src="http://adm.smpay.cn${x.logo!}" onerror="this.src='/images/default.png'" width="90px" height="96px"/>
					${x.name!}				
					<img style="display:none" src="/images/transparent.png" class="good" /><br/>
					￥<label>${x.now_price!}</label>元
					<input type="checkbox" id="dish_${x.id!}" name="dish_${x.id!}" class="floatRight">
					<br/>
					<!-- <input id="choosePro" type="button" value="选择" onclick="" class="btn"> 
					<input id="showDetail" type="button" value="介绍" onclick="" class="btn">-->
					
				</li>
 			</#list>
 			</ul>
 		</div>
   		</#list>
   		
   	
		<div id="orderInfo" style="display:none">
			合计￥<label id="sumPrice">0</label>元 共 <a href="#" onclick="openWindow(totalSelectedDishesTemp());" class="orderList"><label id="sumDishes">0</label>道菜<img src="/images/transparent.png" class="orderListICO" /></a> &nbsp;&nbsp;
			<input type="button" value="菜点好了>> " onclick="toCart()" class="orderSubmit">
		</div>
		<div id="orderInfoA">
			<a href="javascript:showClassify();" id="choose" class="choose"><img src="/images/transparent.png" id="chooseICO" class="chooseICO_B" /> 选择菜品分类</a>
			<a href="javascript:openWindow(totalSelectedDishesTemp());" class="orderList">已点 <label id="sumDishesA">0</label> <img src="/images/transparent.png"  class="orderListICO"  style="top: 0px;height: 24px;"/></a>
			<a href="javascript:toCart()" class="orderSubmit">&nbsp;&nbsp;点好了<img src="/images/transparent.png"  class="orderSubmitICO"  style="top: 0px;height: 24px;"/></a>
		</div>
	</div>
 </div>

  <script type="text/javascript" src="/js/menu_Catering.js"></script>
  <script type="text/javascript">
 /********登录弹出*******/
		//加载已点菜品，优先加载从地址栏带入的菜品（返回继续点菜等），然后才加载Cookie中储存的菜品
	/*if ( window.location.search.indexOf("id=") > 0 && window.location.search.split("=")[0]!="?sid" )
	{
		var orderDishes = window.location.search.split("id=")[1].split(",");
		if ( window.location.search.split("&") )//如果地址栏还有其它参数，只取菜品id
		{
			var orderDishes = window.location.search.split("id=")[1].split("&")[0].split(",");
		}
		for ( i=0 ; i < orderDishes.length ; i++ )
		{
			document.getElementById( "dishes_" + orderDishes[i] ).style.backgroundColor = '#E1E1E1';
			document.getElementById( "dishes_" + orderDishes[i] ).getElementsByTagName("input")[0].checked = true;
			selectedDishes.push( orderDishes[i] );
		}
		sum();
		
	}
	else{*/
		var cookieDishes = getCookie(shop).split(",");
		//alert( getCookie(shop) );
		for ( i=0 ; i < cookieDishes.length ; i++ )
			{
				document.getElementById( "dishes_" + cookieDishes[i] ).style.backgroundColor = '#E1E1E1';
				document.getElementById( "dishes_" + cookieDishes[i] ).getElementsByTagName("input")[0].checked = true;
				selectedDishes.push( cookieDishes[i] );
				
			}
		sum();//alert("tests=="+getCookie(shop));
	//}

	function toCart(){
		//var telNumber = prompt("请输入您的手机号");
		//sum();
		var dishNum = document.getElementById("sumDishesA").innerHTML;
		if(dishNum=="" || dishNum=="0"){
			Message("至少选择一份！");
			return;
		}
		window.location.href = "/cart/view/${shopPo.id!}" ;
		//setCookie(shop,"",30);
	}
  </script>
 </body>
</html>


